#pragma once

#include <ctime>

#include <string>
#include <memory>
#include <list>
#include <map>
#include <set>

#include "util/dynamic-obj.h"
#include "util/fs.h"

#include "part.h"

namespace html::tmplt
{

class Template
{
public:
    Template(const fs::path &path);

    void render(const std::map<std::string, DynamicObj> &objs, std::ostream &out) const;

    bool isOutdated(fs::file_time_type createTime) const;

private:
    std::list<Part> parts_;
    std::set<fs::path> deps_;
};

} // namespace html::tmplt
